/*
 * Copyright (c) 2011 Nokia Corporation.
 */

#ifndef BUSINESSCARDHANDLING_H
#define BUSINESSCARDHANDLING_H

#include <QObject>
#include <QPointer>
#include <QPixmap>

// QtMobility API headers
// Contacts
#include <QContactDetailFilter>
#include <QContactManager>
#include <QContactPhoneNumber>
#include <QContactSortOrder>
#include <QContact>
#include <QContactName>
#include <QContactAvatar>


// QtMobility namespace
QTM_USE_NAMESPACE

class BusinessCardHandling: public QObject
{
Q_OBJECT

public:
    BusinessCardHandling(QObject *parent = 0);
    ~BusinessCardHandling();

    bool findContact(const QString phoneNumber, QContact& contact);

public slots:
    void storeAvatarToContact(QString, QString, QPixmap);

private:
    void createContactManager();
    void saveAvatar(const QString filename, QPixmap p, QContact& contact);

private:
    QPointer<QContactManager> m_contactManager;
};

#endif // BUSINESSCARDHANDLING_H
